<?PHP use_javascript("/js/i18n/grid.locale-cn.js") ?>
<?PHP use_javascript("/js/jquery.jqGrid.min.js") ?>
<?PHP use_stylesheet("/css/ui.jqgrid.css") ?>
<?PHP include_partial("global/rightnow") ?>

<script type="text/javascript">
    $(document).ready(function(){


        $("#table_voucher_list").jqGrid({
            url: "<?PHP echo url_for("voucher/getVoucherList.json") ?>",
            datatype: "json",
            width: 700,
            colNames:["Id","年度","月份","编号","借方金额合计", "贷方金额合计","凭证日期","录入人员","状态"],
            //colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
            colModel:[
                {name: "id", hidden: true},
                {name: "acct_year"},
                {name: "mon"},
                {name: "voucher_sn"},
                {name: "debit_amount", align:"center"},
                {name: "credit_amount", align:"center"},
                {name: "date"},
                {name: "opr_name"},
                {name: "status"}
                
            ],
            rowNum: 10,
            rowList: [10,20,30],
            pager: "#pager_voucher_list",
            sortname: 'id',
            viewrecords: true,
            sortorder: "desc",
            caption: "&nbsp;",
            subGrid: true,
            subGridUrl: "<?PHP echo url_for("voucher/getVoucherD.json") ?>",
            subGridModel: [{
                    name: ['摘要', '科目', '借方金额', '贷方金额'],
                    width: [80,150,60,60],
                    params: ['id']
            }]
            
        });
        $("#table_voucher_list").jqGrid('navGrid','#pager_voucher_list',{edit:false, add:false, del:false });
        

    });

</script>

<div id="box">
    <h3>会计凭证列表</h3>
    <table id="table_voucher_list" width="100%" align="center">
    </table>
    <div id="pager_voucher_list"></div>


</div>
<br />



